<?php htmlTemplate('admin_header_frame.php');?>
<script type="text/javascript">
<!--
function checkForm(){
	var name = $.trim($("#cate_name").val());
	var sort =  $.trim($("#sort").val());
	if (name==''){	
		parent.showAlert('分类名称不能为空！');
		
	}else{
		<?php
		if ($cate) {
			$url=MVC_WWW_HOST.'admin/section/catemodify/do/update/id/'.$cate['id'];
		}else{
			$url=MVC_WWW_HOST.'admin/section/addcate/do/add';
		}
		?>
		var url = '<?php echo $url;?>';
		
		$.getJSON(url,{'name':name,'sort':sort},function(rs){
			if(rs.status==1){
				parent.showAlert(rs.html);
				setTimeout(function(e){
					tourl('<?php echo MVC_WWW_HOST.'admin/section/cate';?>');
				},3000);
			}else{
				parent.showAlert(rs.html);
			}
		})
	}
	return false;
}
//-->
</script>
<div class="title">添加区块分类
</div>
<form action="" method="post" onsubmit="return checkForm();">
<div style="padding:30px;text-align:center;">
区块分类名称： 

		<?php if ($cate){?>
		<input type="text" style="width:200px;" name="cate_name" id="cate_name" value="<?php echo $cate['cname'];?>">
		<?php }else{?>
		<input type="text" style="width:200px;" name="cate_name" id="cate_name">
		<?php }?>
		
		

	排列顺序： 
	
		<?php if ($cate){?>
		<input type="text" style="width:200px;" name="sort" id="sort" value="<?php echo $cate['sorts'];?>">
		<?php }else{?>
		<input type="text" style="width:50px;" name="sort" id="sort">
		<?php }?>
		
		<input type="submit" value="确 认"  class="submit"/>&nbsp;
</div>		

</form>
